<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://agi.corp.org/authz" prefix="authz"%>
<%@ page import="th.co.mfec.mca.common.PrivConst"%>
<center>
    <div id="content">
      <div class="topic">User Group Authorization</div>
      <s:form id="form" action="userGroupAuthorization-getAuthListByGroup.htm" method="POST">
      <div id="searchForm" class="dataField">
        <div class="subTopic">Choose criteria to search screen name or object name records</div>
          <div class="tableContent">
            <table>
              <tr>
                <th><s:text name="label.userGroup" /><span class="star">*</span> :</th>
                <td><s:select id="userGroupSelected" 
                			  name="userGroupSelected" 
                			  headerKey="0" 
                			  headerValue="-- Please Select --"
                			  key="key"
                			  value="value"
                			  list="userGroupMap">
                	</s:select>
                	<br/><span id="errorsDiv_userGroupSelected"></span>
                </td>
              </tr>
              <tr>
                <th>&nbsp;</th>
                <td>&nbsp;</td>
              </tr>
            </table>
          </div>
      </div>
      <!-- button -->
      <div class="button">
          <center>
   		  <table class="button">
            <tr>
              <td><authz:authorize granted="<%=PrivConst.S060100%>" ><span id="button"><a id="searchButton"><span><s:text name="button.search" /></span></a></span></authz:authorize></td>
              <td><span id="button"><a id="clearButton"><span><s:text name="button.clear" /></span></a></span></td>
            </tr>
            <tr>
              <th>&nbsp;</th>
              <td>&nbsp;</td>
            </tr>
    	  </table>
  		  </center>
      </div>
      </s:form>
    </div>
</center>
<script type="text/javascript">

$j(document).ready(function() { 

	$j("#searchButton").click(function () {
		var form = document.forms['userGroupAuthorization-getAuthListByGroup'];
	    var rules=new Array();
	    
	    rules[1]='userGroupSelected:User Group|notequal|0|' + MESSAGE_CODE_USA0001;

	    if (yav.performCheck('form', rules, 'inline')){
	    	$j("#form")
  	 		.attr("action","userGroupAuthorization-getAuthListByGroup.htm")
  	 		.submit();	 
	  		
		}else{
		}
		
	});

	$j("#clearButton").click(function () {
			$j("#form")
		 		.attr("action","userGroupAuthorization-init.htm")
		 		.submit();
	});
});
</script>

